package cn.tedu.boot0413.mapper;

import cn.tedu.boot0413.entity.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProductMapper {

    @Insert("INSERT INTO product VALUES(NULL,#{title},#{price},#{num})")
    void insert(Product product);

    @Select("SELECT * FROM product")
    List<Product> select();

    @Delete("DELETE FROM product WHERE id=#{id} ")
    void delete(int id);

    @Update("UPDATE product SET title=#{title},price=#{price},num=#{num} WHERE id=#{id}")
    void update(Product product);
}
